package com.qf.lja.enity;

public class Product {
    private Integer productId;
    /**
     * 商品名称
     */
    private String productName;
    /**
     * 商品价格
     */
    private Double price;
    /**
     * 商品上市时间
     */
    private String launchDate;
    /**
     * 商品图片链接
     */
    private String imageUrl;
    /**
     * 商品热门指数
     */
    private Integer popularityIndex;
    /**
     * 上架下架状态，0：下架，1：上架
     */
    private Integer status;

    private Integer inventory;

    public Integer getInventory() {
        return inventory;
    }

    public void setInventory(Integer inventory) {
        this.inventory = inventory;
    }

    /**
     * 商品描述
     */
    private String description;
    /**
     * 修改时间
     */
    private String modifiedAt;

    public Integer getProductId() {
        return productId;
    }

    public void setModifiedAt(String modifiedAt) {
        this.modifiedAt = modifiedAt;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getLaunchDate() {
        return launchDate;
    }

    public void setLaunchDate(String launchDate) {
        this.launchDate = launchDate;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public Integer getPopularityIndex() {
        return popularityIndex;
    }

    public void setPopularityIndex(Integer popularityIndex) {
        this.popularityIndex = popularityIndex;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Product{" +
                "productId=" + productId +
                ", productName='" + productName + '\'' +
                ", price=" + price +
                ", launchDate='" + launchDate + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                ", popularityIndex=" + popularityIndex +
                ", status=" + status +
                ", description='" + description + '\'' +
                ", modifiedAt=" + modifiedAt +
                '}';
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    //主页展示字段
    private String index_name;

    public String getModifiedAt() {
        return modifiedAt;
    }

    public String getIndex_name() {
        return index_name;
    }

    public void setIndex_name(String index_name) {
        this.index_name = description.substring(1, 15) + "...";
    }
}
